var TiminstemiAssistant = Class.create(AbstractModule, {


setupWidgets: function() {

		//About
		this.controller.setupWidget(Mojo.Menu.appMenu, {
			omitDefaultItems: true
		}, {
			visible: true,
			items: [
      		Mojo.Menu.editItem,
			{ label: "Disclaimer", command: "do-disclaimer" },					
				{ label: "License", command: "do-license" },
				{ label: "Help", command: "do-help" }
			]
		});

this.help = true;

  

	
	this.toggleModel = {
			ageCHK: false
			};
	this.toggleModel = {
		rfCHK: false
			};
	this.toggleModel = {
			cadCHK: false
			};
			
	this.toggleModel = {
			asaCHK: false
			};						
	this.toggleModel = {
			anginaCHK: false
			};
			
	this.toggleModel = {
			stcCHK: false
			};
			
	this.toggleModel = {
			ecmCHK:false		
			};									

			
	this.controller.setupWidget("ageCHK", {
			modelProperty: "ageCHK"
		}, this.toggleModel);

	this.controller.setupWidget("rfCHK", {
			modelProperty: "rfCHK"
		}, this.toggleModel);

	this.controller.setupWidget("cadCHK", {
			modelProperty: "cadCHK"
		}, this.toggleModel);

	this.controller.setupWidget("asaCHK", {
			modelProperty: "asaCHK"
		}, this.toggleModel);
		
	this.controller.setupWidget("anginaCHK", {
			modelProperty: "anginaCHK"
		}, this.toggleModel);
	this.controller.setupWidget("stcCHK", {
			modelProperty: "stcCHK"
		}, this.toggleModel);
	this.controller.setupWidget("ecmCHK", {
			modelProperty: "ecmCHK"
		}, this.toggleModel);
	
},



	calculate: function() {
	var result = timinstemicalc(this.toggleModel.ageCHK,this.toggleModel.rfCHK,this.toggleModel.cadCHK,this.toggleModel.asaCHK,this.toggleModel.anginaCHK,this.toggleModel.stcCHK,this.toggleModel.ecmCHK);
 
	return "The TIMI score is " + result.timiscore + " which represents " + result.mortality;
	}
});





